<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>WDShare 西安前端开发者分享社区</title>
<meta name="keywords" content="WDShare,西安前端交流会,西安前端技术社区,web开发社区" />
<meta name="description" content="WDShare, Web Developer Share 西安前端开发者分享社区" />
<% include ./etc/htmlhead.ejs %>
</head>

<body>
<% include ./etc/head.ejs %>

<% if ( affiche && affiche != "error" && affiche.title.indexOf("关闭") < 0 ) { %>
<div class="inform">
  <div class="maxWidth">
    <div class="inform-con"><%-affiche.content%></div>
  </div>
</div>
<% } %>

<% if ( active ) { %>
<div class="activity ">
  <div class="maxWidth module">
    <h2 class="module-title">
      <div class="module-but"><a href="/about" class="no-but red">什么是WDShare？</a></div>
      精彩活动
    </h2>
    <div class="activity-con">
      <% active.result.forEach(function(active){ %>
      <a href="/active/<%= active._id %>" class="activity-item">
        <h3 class="activity-title"><em><%= active.aName %></em></h3>
        <div class="activity-type">
          <span class="activity-date">时间：<%= active.aTime %></span>
          <span class="activity-click">点击：<%= active.aClick ? active.aClick : 0 %></span>
          <!-- <span class="activity-comment">评论：15</span> -->
        </div>
        <% if ( active.aStatus == 1 ) { %>
        <div class="activity-state"><span class="open">报名</span></div>
        <% } else if ( active.aStatus == 2 ) { %>
        <div class="activity-state"><span class="stop">暂停</span></div>
        <% } else if ( active.aStatus == 3 ) { %>
        <div class="activity-state"><span class="ready">筹备</span></div>
        <% } else { %>
        <div class="activity-state"><span class="over">详情</span></div>
        <% } %>
      </a>
      <% }) %>
    </div>
    <div class="mudule-more"><a href="/active/" class="but but-blue">更多活动</a></div>
  </div>
</div>
<% } %>


<div class="index-article">
  <div class="maxWidth module">
    <h2 class="module-title">
      <div class="module-but"><a href="/article/create">发布文章</a></div>
      精彩文章
    </h2>
    <div class="article-list-con">
      <% var articleCount = 0 %>
      <% article.forEach(function(article){ %>
      <% if ( articleCount < 10 ) { %>
      <%
        articleCount++;

        var tou = false,
            hot = false,
            _strong = false,
            types = [];
        if ( article.diyType ) {
          types = article.diyType.split(",");
        }
        for ( var i=0; i<types.length; i++ ) {
          if ( parseInt(types[i]) === 1 ) {
            tou = true;
          }
          if ( parseInt(types[i]) === 2 ) {
            hot = true;
          }
          if ( parseInt(types[i]) === 3 ) {
            _strong = true;
          }
        }
      %>
      <div class="article-item">
        <% if ( !article.user ) { %>
        <div class="article-item-user"><img src="/static/users/default-face.png" title="该用户消失了" /></a></div>
        <% } else { %>
        <div class="article-item-user"><a href="/user/<%= article.userId %>" title="发布者：<%= article.user %>"><img src="/user/face/<%= article.userId %>" /></a></div>
        <% } %>
        <div class="article-item-text">
          <h3 class="article-item-title">
            <a href="/article/<%= article._id %>" title="<%= article.title %>"<% if ( article.linkUrl ) { %> target="_blank"<% } %>><em style="<% if ( article.color ) { %>color:<%= article.color %>;<% } %> font-weight:<%= _strong ? "bold" : "normal" %>;"><%= article.title %></em><% if ( article.linkUrl ) { %><span class="link-url">[外链]</span><% } %></a>
          </h3>
          <div class="article-item-type">
            <span class="article-item-channel"><a href="/article/<%= article.channelUrl %>">[<%= article.channel %>]</a></span>
            <span class="article-item-date" title="<%= moment(article.editDate).format('YYYY-MM-DD HH:mm:ss') %>">时间：<%= moment(article.editDate).format('YYYY-MM-DD') %></span>
            <span class="article-item-click">点击：<%= article.click ? article.click : 0 %></span>
            <% if ( !article.linkUrl ) { %>
            <span class="article-item-comment">赞：<%= article.zan ? article.zan : 0 %></span>
            <% } %>
          </div>
        </div>
      </div>
      <% } %>
      <% }) %>
    </div>
    <div class="mudule-more"><a href="/article/" class="but but-blue">更多文章</a></div>
  </div>
</div>

<!--
<% if ( jobs && jobs != "error" ) { %>
<div class="index-job">
  <div class="maxWidth module">
    <h2 class="module-title">
      <div class="module-but"><a href="/jobs/create">发布招聘</a></div>
      企业招聘
    </h2>
    <div class="index-jobs-con">
      <% var jobsCount = 0 %>
      <% jobs.forEach(function(job){ %>
      <% if ( jobsCount < 10 ) { %>
      <%
        jobsCount++;

        var tou = false,
            hot = false,
            _strong = false,
            types = [];
        if ( job.diyType ) {
          types = job.diyType.split(",");
        }
        for ( var i=0; i<types.length; i++ ) {
          if ( parseInt(types[i]) === 1 ) {
            tou = true;
          }
          if ( parseInt(types[i]) === 2 ) {
            hot = true;
          }
          if ( parseInt(types[i]) === 3 ) {
            _strong = true;
          }
        }
      %>

      <%
        var _date = job.editDate,
            interval = (new Date()).getTime() - _date,
            dataString = "刚刚",
            count;
        
        if ( interval > 1000*60*5 ) {
            count = Math.floor(interval/(1000*60));
            dataString = count + "分钟前";
        }
        if ( interval > 1000*60*30 ) {
            dataString = "半小时前";
        }
        if ( interval > 1000*60*60 ) {
            count = Math.floor(interval/(1000*60*60));
            dataString = count + "小时前";
        }
        if ( interval > 1000*60*60*24 ) {
            count = Math.floor(interval/(1000*60*60*24));
            dataString = count + "天前";
        }
        if ( interval > 1000*60*60*24*365 ) {
            count = Math.floor(interval/(1000*60*60*24*365));
            dataString = count + "年前";
        }
        %>
      <div class="index-jobs-item">
        <div class="index-jobs-item-face"><a href="/companys/<%= job.companys %>" title="企业：<%= job.companyName %>" style="background-image:url('/user/comlogo/<%= job.companys %>');"></a></div>
        <div class="index-jobs-item-text">
          <h3 class="index-jobs-item-title">
            <a href="/jobs/<%= job._id %>" title="<%= job.title %>"><em style="<% if ( job.color ) { %>color:<%= job.color %>;<% } %> font-weight:<%= _strong ? "bold" : "normal" %>;">[<%= job.cityName %>] <%= job.title %></em></a><span title="<%= moment(job.editDate).format('YYYY-MM-DD HH:mm:ss') %>"><%= dataString %></span>
          </h3>
          <p>
            <strong><%= job.salaryStart %>k-<%= job.salaryEnd %>k</strong>
            <span>经验<%= job.workingLifeName %> / <%= job.diplomaName %> / 同职位人数：<%= job.jobmax %>人</span>
          </p>
        </div>
        <div class="index-jobs-item-allure"><%= job.allure %></div>
      </div>
      <% } %>
      <% }) %>
    </div>
    <div class="mudule-more"><a href="/jobs/" class="but but-blue">更多招聘</a></div>
  </div>
</div>
<% } %>
-->

<% if ( users && users != "error" ) { %>
<div class="index-mamber" style="background:#fff;">
  <div class="maxWidth module">
    <h2 class="module-title">
      <% if(!user){ %>
      <div class="module-but"><a href="/user/register">加入我们</a></div>
      <% } %>
      WDShare新进学员<span class="module-title-note">学员总数：<%= users.allCount %>位</span>
    </h2>
    <div class="mamber-con">
      <% users.result.forEach(function(member){ %>
      <div class="mamber-item">
        <div class="mamber-face"><a href="/user/<%=member._id%>"><img src="/user/face/<%=member._id%>" /></a></div>
        <div class="mamber-text">
          <h3 class="mamber-title">
            <a href="/user/<%=member._id%>"><%=member.username%></a>
          </h3>
          <div class="mamber-type">
            <% if ( member.userInfo.tag ) { %>
            <%
            var tags = member.userInfo.tag;
            tags = tags.split(",");
            %>
            <div class="mamber-label">
              <a href="#" onclick="return false;">标签<em></em></a>
              <ul>
                <% tags.forEach(function(tag){ %>
                <li><%= tag %></li>
                <% }) %>
              </ul>
            </div>
            <% } %>
            <!-- <div class="mamber-label">
              <a href="#">勋章<em></em></a>
              <ul>
                <li>群主</li>
                <li>WDShare创始团队</li>
                <li>官网贡献者</li>
                <li>WDShare技术文章贡献者</li>
              </ul>
            </div> -->
            <span class="mamber-atricle">文章：<%= member.article%></span>
            <!-- <span class="mamber-project">项目：5</span> -->
            <span class="mamber-good">赞：<%= member.userInfo.zan ? member.userInfo.zan : 0 %></span>
            <span class="mamber-job">橄榄枝：<%= member.userInfo.offer ? member.userInfo.offer : 0 %></span>
          </div>
        </div>
      </div>
      <% }) %>
    </div>
    <div class="mudule-more"><a href="/user/all" class="but but-blue">更多学员</a></div>
  </div>
</div>
<% } %>

<% include ./etc/foot.ejs %>
</body>
</html>